package com.demo2do.boyle.client.handler;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author lute, Wilson
 *
 */
public interface CookieHandler {

    /**
     * get cookie from request with name
     * 
     * @param name
     * @param request
     * @return
     */
    public String getCookie(String name, HttpServletRequest request);

    /**
     * @param name
     * @param value
     * @param request
     * @param response
     */
    public void addCookie(String name, String value, HttpServletRequest request, HttpServletResponse response);

    /**
     * Add cookie to browser with specified expire time
     * 
     * @param name
     * @param value
     * @param expireTime
     * @param request
     * @param response
     */
    public void addCookie(String name, String value, int expireTime, HttpServletRequest request, HttpServletResponse response);

    /**
     * Delete cookie by cookie name
     * 
     * @param name
     * @param request
     * @param response
     */
    public void deleteCookie(String name, HttpServletRequest request, HttpServletResponse response);

}
